package com.yonyou.pmclouds.safetyrectification.entity;

import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.safetyrectification.assignrecord.entity.AssignRecordVO;
import com.yonyou.pmclouds.safetyrectification.rectificationrecord.entity.RectificationRecordVO;
import com.yonyou.pmclouds.safetyrectification.relationuser.entity.RelationUserVO;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 安全整改VO
 *
 * @author th
 * @date 2019/10/24 9:49
 */
@Table(name = "pm_safety_rectification")
@Data
public class SafetyRectificationVO extends SuperVO {
    public static final String PK_RECTIFICATIONER = "pkRectificationer";
    public static final String DEADLINE = "deadline";
    public static final String RECTIFICATIONER_NAME = "rectificationerName";
    public static final String PK_CONSTRUCTION_UNIT = "pkConstructionUnit";
    public static final String CONSTRUCT_UNIT_NAME = "constructUnitName";
    public static final String BILL_STATUS = "billStatus";
    public static final String RECTIFY_TIMES = "rectifyTimes";
    public static final String STR_DEADLINE = "strDeadline";
    public static final String STR_CREATIONTIME = "strCreationTime";
    public static final String RECTIFICATIONAREA = "rectificationArea";

    /**
     * 区分移动端操作构造不同的通知内容
     */
    public static final String OPERATION_ADD = "add";
    public static final String OPERATION_ASSIGN = "assign";
    public static final String OPERATION_RECTIFY = "rectify";
    public static final String OPERATION_PASS = "pass";
    public static final String OPERATION_NO_PASS = "rectifyAgain";
    /**
     * 工程部位
     */
    public static String PK_PROJECTPART = "pkProjectpart";

    /**
     * 单据字段
     */
    @Id
    private String pkSafetyRectification;
    @NotNull
    private String pkProject;
    /**
     * 整改区域
     */
    private String rectificationArea;
    /**
     * 施工单位
     */
    @NotNull
    private String pkConstructionUnit;
    /**
     * 问题原因
     */
    @NotNull
    private String pkProblemReason;
    private String description;
    /**
     * 严重程度
     */
    @NotNull
    private Byte severityLevel;
    /**
     * 整改人
     */
    @NotNull
    private String pkRectificationer;
    /**
     * 整改期限
     */
    @NotNull
    private Date deadline;
    /**
     * 整改次数
     */
    private Integer rectifyTimes;
    @NotNull
    private String pkTenant;
    private String billType;
    private Byte billStatus;
    private String creator;
    private Date creationtime;
    private String modifier;
    private Date modifytime;
    private BigDecimal longitude;
    private BigDecimal latitude;
    private String position;

    private String pkProjectpart;//工程部位
    @Transient
    private String projectpartName;//工程部位名称
    /**
     * 抄送人
     */
    @Transient
    private List<RelationUserVO> relationUserList;
    /**
     * 整改记录
     */
    @Transient
    private List<RectificationRecordVO> rectificationRecordList;
    /**
     * 交办记录
     */
    @Transient
    private List<AssignRecordVO> assignRecordList;

    /**
     * 前台页面显示字段
     */
    @Transient
    private String projectName;
    @Transient
    private String projectCode;
    @Transient
    private String problemReasonName;
    @Transient
    private String rectificationerName;
    @Transient
    private int picNum;
    @Transient
    private String creatorName;
    @Transient
    private String[] pictures;
    @Transient
    private boolean overTime;

    @Transient
    private String strCreationTime;
    @Transient
    private String pictureAddress; // 照片真实地址(用于存储HTML形式)
    @Transient
    private String orgName;
    @Transient
    private String strDeadline;
    @Transient
    private String strBillStatus;
    @Transient
    private String pkRectifyEnter;
    @Transient
    private String rectifyEnterName;
    @Transient
    private String operation;
    @Transient
    private String modifierName;
    @Transient
    private String constructUnitName;
    @Transient
    private String strSeverityLevel;
    /**
     * 抄送人名称集合
     */
    @Transient
    private List<String> relationUserNameList;

    public String taskReceiverField() {
        return PK_RECTIFICATIONER;
    }

}
